export default {
  namespaced: true,
  state: {
    status: false,
    content: "默认",
    type: "success",
  },

  mutations: {
    changeStatus(state, { status, content, type } = {}) {
      state.status = status;
      state.content = content;
      state.type = type;
    },
  },

  actions: {
    asyncChangeStatus(context, { content, type } = {}) {
      context.commit("changeStatus", {
        status: true,
        content,
        type,
      });
      setTimeout(() => {
        context.commit("changeStatus", {
          status: false,
          content,
          type,
        });
      }, 2000);
    },
  },
};
